package com.example.zhucongjdbc.service;

import com.example.zhucongjdbc.entity.User;
import com.example.zhucongjdbc.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @Author:mayc
 * @Date:2020/3/9 21:19
 */
@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public Long addUser(User user) {

        // 强制路由主库
        //HintManager.getInstance().setMasterRouteOnly();
        return userMapper.addUser(user);
    }

    public List<User> list() {

        return userMapper.list();
    }
}
